# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=gst-plugins-rs
pkgver=0.12.4
pkgrel=0
pkgdesc="Gstreamer rust plugins"
url="https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
# ppc64le, s390x, riscv64: ring in gst-plugin-version-helper
# armv7, armhf, x86: ring in gtk4
arch="all !armhf !armv7 !ppc64le !riscv64 !s390x !x86"
license="MIT AND Apache-2.0 AND MPL-2.0 AND LGPL-2.1-or-later"
makedepends="
	cargo
	cargo-c
	dav1d-dev
	gst-plugins-bad-dev
	gst-plugins-base-dev
	gtk4.0-dev
	libsodium-dev
	meson
	nasm
	openssl-dev
	"
subpackages="$pkgname-dev $pkgname-tools"
source="https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/archive/$pkgver/gst-plugins-rs-$pkgver.tar.gz
	dylib.patch
	"
options="net !check" # they don't run

export SODIUM_USE_PKG_CONFIG=1

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	export CARGO_PROFILE_RELEASE_OPT_LEVEL=3
	abuild-meson \
		--buildtype=release \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

tools() {
	amove usr/bin
}

sha512sums="
1ef76d1ee8778e474590f6f2c7a88cd94b1496cd242b64282710d0fba54fc3f807a7a8e58e58437f44c365d65e5ce8d21bcf72d9aff55033695327849eced00d  gst-plugins-rs-0.12.4.tar.gz
5f354a7776859f62a235947b5a31779688bc681f3c47c3fbf85806c8a12f68023a731067c958e40dfd580af591ea271e4e5184ef3b45a193c9b855486c64fef0  dylib.patch
"
